/*
 * Created by Gibbs on 2021/1/1.
 * Copyright (c) 2021 Gibbs. All rights reserved.
 */

#ifndef GPLAYER_LOOPTHREADHELPER_H
#define GPLAYER_LOOPTHREADHELPER_H


#include "LoopThread.h"
#include <functional>

class LoopThreadHelper {
public:
    static LoopThread *createLoopThread(const std::string &name,
                                        const std::function<int(int, long)> &updateFunc);

    static LoopThread *createLoopThread(const std::string& name,
                                        const std::function<int(int, long)> &updateFunc,
                                        const std::function<void(int, std::string)> &notifyFunc);

    static LoopThread *createLoopThread(const std::string &name,
                                        const std::function<void(void)> &startFunc,
                                        const std::function<int(int, long)> &updateFunc,
                                        const std::function<void(void)> &endFunc);

    static LoopThread *createLoopThread(const std::string &name,
                                        const std::function<void(void)> &startFunc,
                                        const std::function<int(int, long)> &updateFunc,
                                        const std::function<void(void)> &endFunc,
                                        const function<void(int, std::string)> &notifyFunc);

    static void stopLoopThread(LoopThread *thread);
};


#endif //GPLAYER_LOOPTHREADHELPER_H
